package edu.sdcet.mybatisdemo.service.impl;

import edu.sdcet.mybatisdemo.entity.Student;
import edu.sdcet.mybatisdemo.mapper.StudentMapper;
import edu.sdcet.mybatisdemo.service.StudentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {
    private static final Logger logger = LoggerFactory.getLogger(StudentServiceImpl.class);
    
    //注入StudentMapper
    @Autowired
    private StudentMapper studentMapper;

    public Student getStudentById(String StudentId) {
        logger.info("查询学生信息：studentId={}", StudentId);
        Student student = studentMapper.getStudentById(StudentId);
        logger.info("查询结果：student={}", student);
        return student;
    }
}
